package com.butcher.framework.kernel.endpoint.http;

import com.butcher.framework.kernel.endpoint.http.service.Service;
import com.butcher.framework.kernel.endpoint.http.service.ServiceFactory;
import com.butcher.framework.kernel.endpoint.http.service.ServiceRegistry;

public class FastHttp {
	private ServiceFactory factory;
	private ServiceRegistry registry;

	public FastHttp(ServiceRegistry registry) {
		this.registry = registry;

		this.factory = new ServiceFactory();
	}

	public FastHttp(ServiceRegistry registry, ServiceFactory factory) {
		this.factory = factory;
		this.registry = registry;
	}

	public ServiceRegistry getServiceRegistry() {
		return this.registry;
	}

	public ServiceFactory getServiceFactory() {
		return this.factory;
	}

	public Service findService(String name) {
		return this.registry.findService(name);
	}

	public void unregister() {
		this.registry.unregister();
	}

	public void setFactory(ServiceFactory factory) {
		this.factory = factory;
	}

	public void setRegistry(ServiceRegistry registry) {
		this.registry = registry;
	}
}